﻿<Window x:Class="ComicViewer.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local ="clr-namespace:ComicViewer"
    Title="Comic Viewer" Height="622" Width="804" x:Name="mainWindow" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Style="{DynamicResource WindowStyle}" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Luna" Loaded="mainWindow_Loaded" Background="#FF000000" Foreground="#FFFFFFFF" WindowStyle="None" Closed="mainWindow_Closed">
	<Window.Resources>
        <local:ArchiveImageToThumbnailImage x:Key="ArchiveImageToThumbnailImage" />
        <local:ArchiveImageToPageNo x:Key="ArchiveImageToPageNo" />
        <local:ArchiveImageToImage x:Key="ArchiveImageToImage" />
        <local:PanelModeToInt x:Key="PanelModeToInt" />
        <local:PanelModeToBool x:Key="PanelModeToBool"/>
        <local:RotatePageToTransForm x:Key="RotatePageToTransForm"/>
        <local:RotatePageToBool x:Key="RotatePageToBool"/>
        <local:IndexToPageNo x:Key="IndexToPageNo"/>
        <local:ImageEffectTypeToInt x:Key="ImageEffectTypeToInt"/>
        <local:ZoomToSizingType x:Key="ZoomToSizingType"/>
        <local:ZoomTextToBool x:Key="ZoomTextToBool"/>
		<ItemsPanelTemplate x:Key="ListBoxVirtualization">
			<VirtualizingStackPanel IsItemsHost="True"/>
		</ItemsPanelTemplate>
		<DataTemplate x:Key="ThumbNailItemTemplate">
			<StackPanel>
				<Image Width="100" Height="100" Source="{Binding Path=ImageData, Converter={StaticResource ArchiveImageToThumbnailImage}}" Stretch="Uniform"/>
				<TextBlock TextWrapping="Wrap" HorizontalAlignment="Center" Foreground="#FFFFFFFF" Text="{Binding Path=PageNo, Converter={StaticResource ArchiveImageToPageNo}}"/>
			</StackPanel>
		</DataTemplate>
		<DataTemplate x:Key="MainImageItemTemplate">
			<Grid Height="Auto" Width="Auto">
				<Image Stretch="Uniform" Source="{Binding Path=ImageData, Converter={StaticResource ArchiveImageToImage}, Mode=OneWay}" Margin="0,0,0,5" RenderTransformOrigin="0.5,0.5"
                       RenderTransform="{Binding Source={x:Static Application.Current},Path=MainWindow.RotatePage,Mode=OneWay,Converter={StaticResource RotatePageToTransForm}}"
                       Effect="{Binding Source={x:Static Application.Current},Path=MainWindow.ActualEffect,Mode=OneWay}"/>
					
			</Grid>
		</DataTemplate>
		<ItemsPanelTemplate x:Key="ItemsPanelTemplate">
			<local:MainImagePanel ZoomText="{Binding Source={x:Static Application.Current}, Path=MainWindow.ZoomText, Mode=OneWay}" 
                                  IsFileOpen="{Binding Source={x:Static Application.Current}, Path=MainWindow.IsFileOpened, Mode=OneWay}"
                                  PanelMode="{Binding Source={x:Static Application.Current},Path=MainWindow.PanelMode,Mode=OneWay}"
                                  PageSize="{Binding Source={x:Static Application.Current},Path=MainWindow.PageSize,Mode=OneWay}"
                                  HorizontalAlignment="Center"
                                  CurrentPageChanged="MainImagePanel_CurrentPageChanged"
                                  GoToPage="{Binding Source={x:Static Application.Current}, Path=MainWindow.GoToPage,Mode=OneWay}"
                                  RotatePage="{Binding Source={x:Static Application.Current},Path=MainWindow.RotatePage,Mode=OneWay}"/>
		</ItemsPanelTemplate>
		<Style x:Key="ItemsControlStyle" TargetType="{x:Type ItemsControl}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ItemsControl}">
						<ScrollViewer CanContentScroll="True" IsDeferredScrollingEnabled="True" Style="{DynamicResource ComicScrollViewerStyle}" Background="#FF000000">
							<ItemsPresenter/>
						</ScrollViewer>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        </Style>
        <ControlTemplate x:Key="ValidationTemplate">
            <DockPanel>
                <TextBlock Foreground="Red" FontSize="20">!</TextBlock>
                <AdornedElementPlaceholder/>
            </DockPanel>
        </ControlTemplate>
		<ControlTemplate x:Key="WindowTemplateKey" TargetType="{x:Type Window}">
			<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
				<Grid>
					<AdornerDecorator>
						<ContentPresenter/>
					</AdornerDecorator>
					<ResizeGrip HorizontalAlignment="Right" x:Name="WindowResizeGrip" VerticalAlignment="Bottom" IsTabStop="false" Visibility="Collapsed"/>
				</Grid>
			</Border>
			<ControlTemplate.Triggers>
				<MultiTrigger>
					<MultiTrigger.Conditions>
						<Condition Property="ResizeMode" Value="CanResizeWithGrip"/>
						<Condition Property="WindowState" Value="Normal"/>
					</MultiTrigger.Conditions>
					<Setter Property="Visibility" TargetName="WindowResizeGrip" Value="Visible"/>
				</MultiTrigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<Style x:Key="WindowStyle" TargetType="{x:Type Window}">
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Window}">
						<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
							<AdornerDecorator>
								<ContentPresenter/>
							</AdornerDecorator>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="WindowStyle" Value="None"/>
			<Style.Triggers>
				<Trigger Property="ResizeMode" Value="CanResizeWithGrip">
					<Setter Property="Template" Value="{StaticResource WindowTemplateKey}"/>
				</Trigger>
			</Style.Triggers>
		</Style>
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="3" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackgroundFill" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FFFFFFFF" Offset="0"/>
			<GradientStop Color="#FFF0F0EA" Offset="0.9"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonBorder" Color="#FF003C74"/>
		<ControlTemplate x:Key="MaximiseButtonTemplate" TargetType="{x:Type Button}">
			<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" ThemeColor="NormalColor" BorderBrush="{DynamicResource ComicViewerBorderBrush}" Fill="#FF000000">
				<Canvas>
					<Rectangle Fill="{x:Null}" Stroke="{DynamicResource ComicViewerBorderBrush}" Margin="0,0,0,0" Width="7" Height="5.375" Canvas.Left="3.625" Canvas.Top="1.375"/>
					<Rectangle Fill="{x:Null}" Stroke="{DynamicResource ComicViewerBorderBrush}" Width="9.125" Height="6" Canvas.Top="4"/>
				</Canvas>
			</Microsoft_Windows_Themes:ButtonChrome>
			<ControlTemplate.Triggers>
				<Trigger Property="IsKeyboardFocused" Value="true">
					<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="ToggleButton.IsChecked" Value="true">
					<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<ControlTemplate x:Key="MinimiseButtonTemplate" TargetType="{x:Type Button}">
			<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" ThemeColor="NormalColor" Fill="#FF000000" BorderBrush="{DynamicResource ComicViewerBorderBrush}">
				<Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="{DynamicResource ComicViewerBorderBrush}" Width="7.375" Height="1" Data="M4.125,15.375 L10.5,15.375" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
			</Microsoft_Windows_Themes:ButtonChrome>
			<ControlTemplate.Triggers>
				<Trigger Property="IsKeyboardFocused" Value="true">
					<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="ToggleButton.IsChecked" Value="true">
					<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<SolidColorBrush x:Key="ComicViewerBorderBrush" Color="#FF4D4D4D"/>
		<Style x:Key="NormalButtonStyle" TargetType="{x:Type Control}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="3" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<SolidColorBrush x:Key="ListBorder" Color="#FF7F9DB9"/>
		<Style x:Key="TopButtonsListBoxStyle" TargetType="{x:Type ListBox}">
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBox}">
						<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
							<ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false">
								<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
							</ScrollViewer>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							</Trigger>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ItemsPanelTemplate x:Key="TopButtonsItemsPanelTemplate">
			<VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
		</ItemsPanelTemplate>

		
		<ControlTemplate x:Key="PreviousPageButtonTemplate" TargetType="{x:Type Button}">
			<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" ThemeColor="NormalColor">
				<Path Fill="{DynamicResource ComicViewerBorderBrush}" Stretch="Fill" Stroke="{DynamicResource ComicViewerBorderBrush}" Data="M3.999,6.32 L9.6865001,0.19500017 9.6865001,12.6325 z" Width="6.684" Height="13.437"/>
			</Microsoft_Windows_Themes:ButtonChrome>
			<ControlTemplate.Triggers>
				<Trigger Property="IsKeyboardFocused" Value="true">
					<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="ToggleButton.IsChecked" Value="true">
					<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		
		<ControlTemplate x:Key="NextPageButtonTemplate" TargetType="{x:Type Button}">
			<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" ThemeColor="NormalColor">
				<Path Fill="{DynamicResource ComicViewerBorderBrush}" Stretch="Fill" Stroke="{DynamicResource ComicViewerBorderBrush}" Data="M3.999,6.32 L9.6865001,0.19500017 9.6865001,12.6325 z" Width="6.684" Height="13.437" RenderTransformOrigin="0.5,0.5">
					<Path.RenderTransform>
						<TransformGroup>
							<ScaleTransform ScaleX="1" ScaleY="1"/>
							<SkewTransform AngleX="0" AngleY="0"/>
							<RotateTransform Angle="180"/>
							<TranslateTransform X="0" Y="0"/>
						</TransformGroup>
					</Path.RenderTransform>
				</Path>
			</Microsoft_Windows_Themes:ButtonChrome>
			<ControlTemplate.Triggers>
				<Trigger Property="IsKeyboardFocused" Value="true">
					<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="ToggleButton.IsChecked" Value="true">
					<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		
		<ControlTemplate x:Key="LastPageButtonTemplate" TargetType="{x:Type Button}">
			<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" ThemeColor="NormalColor">
				<Grid Width="15.999" Height="13.946" RenderTransformOrigin="0.5,0.5">
					<Grid.RenderTransform>
						<TransformGroup>
							<ScaleTransform ScaleX="1" ScaleY="1"/>
							<SkewTransform AngleX="0" AngleY="0"/>
							<RotateTransform Angle="180"/>
							<TranslateTransform X="0" Y="0"/>
						</TransformGroup>
					</Grid.RenderTransform>
					<Path Stretch="Fill" Stroke="{DynamicResource ComicViewerBorderBrush}" HorizontalAlignment="Left" Margin="4.054,0,0,0" Width="1.002" Data="M3.999,1.8825 L3.999,11.07" Fill="{DynamicResource ComicViewerBorderBrush}"/>
					<Path Fill="{DynamicResource ComicViewerBorderBrush}" Stretch="Fill" Stroke="{DynamicResource ComicViewerBorderBrush}" Margin="5.062,0.195,4.253,0.314" Data="M3.999,6.32 L9.6865001,0.19500017 9.6865001,12.6325 z"/>
				</Grid>
			</Microsoft_Windows_Themes:ButtonChrome>
			<ControlTemplate.Triggers>
				<Trigger Property="IsKeyboardFocused" Value="true">
					<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="ToggleButton.IsChecked" Value="true">
					<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		
		<Style x:Key="ThumNailListBoxStyle" TargetType="{x:Type ListBox}">
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBox}">
						<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
							<ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false" Template="{DynamicResource ThumNailScrollViewerControlTemplate}" Style="{DynamicResource ComicScrollViewerStyle}">
								<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
							</ScrollViewer>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							</Trigger>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ControlTemplate x:Key="ThumNailScrollViewerControlTemplate" TargetType="{x:Type ScrollViewer}">
			<Grid x:Name="Grid" Background="{TemplateBinding Background}">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="*"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<Rectangle Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" x:Name="Corner" Grid.Column="1" Grid.Row="1"/>
				<ScrollContentPresenter Margin="{TemplateBinding Padding}" x:Name="PART_ScrollContentPresenter" Grid.Column="0" Grid.Row="0" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False"/>
				<ScrollBar Cursor="Arrow" x:Name="PART_VerticalScrollBar" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="1" Grid.Row="0" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="VerticalScrollBar" Background="{DynamicResource ComicViewerBorderBrush}"/>
				<ScrollBar Cursor="Arrow" x:Name="PART_HorizontalScrollBar" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="HorizontalScrollBar" Background="{DynamicResource ComicViewerBorderBrush}"/>
			</Grid>
		</ControlTemplate>
		<SolidColorBrush x:Key="ComicViewerSelectionBG" Color="#FF3E5170"/>
		<Style x:Key="ThumNailListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="Padding" Value="2,0,0,0"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ListBoxItem}">
						<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsSelected" Value="true">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ComicViewerSelectionBG}"/>
							</Trigger>
							<MultiTrigger>
								<MultiTrigger.Conditions>
									<Condition Property="IsSelected" Value="true"/>
									<Condition Property="Selector.IsSelectionActive" Value="false"/>
								</MultiTrigger.Conditions>
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ComicViewerSelectionBG}"/>
							</MultiTrigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<PathGeometry x:Key="Checkmark" Figures="M0,2 L0,4.8 L2.5,7.4 L7.1,2.8 L7.1,0 L2.5,4.6 z"/>
		<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
			<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition MinWidth="17" Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
						<ColumnDefinition Width="14"/>
					</Grid.ColumnDefinitions>
					<ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
					<Path FlowDirection="LeftToRight" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Hidden" Data="{StaticResource Checkmark}" Fill="#FF000000"/>
					<ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True"/>
					<TextBlock Margin="5,2,0,2" x:Name="InputGestureText" Text="{TemplateBinding InputGestureText}" Grid.Column="2" DockPanel.Dock="Right" Foreground="{TemplateBinding Foreground}"/>
				</Grid>
			</Border>
			<ControlTemplate.Triggers>
				<Trigger Property="Icon" Value="{x:Null}">
					<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
				</Trigger>
				<Trigger Property="IsChecked" Value="true">
					<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
					<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
				</Trigger>
				<Trigger Property="IsHighlighted" Value="true">
					<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<Style x:Key="MenuScrollButton" BasedOn="{x:Null}" TargetType="{x:Type RepeatButton}">
			<Setter Property="ClickMode" Value="Hover"/>
			<Setter Property="MinWidth" Value="0"/>
			<Setter Property="MinHeight" Value="0"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RepeatButton}">
						<DockPanel SnapsToDevicePixels="true" Background="Transparent">
							<Rectangle Fill="Transparent" x:Name="R1" Width="1" DockPanel.Dock="Right"/>
							<Rectangle Fill="Transparent" x:Name="B1" Height="1" DockPanel.Dock="Bottom"/>
							<Rectangle Fill="Transparent" x:Name="L1" Width="1" DockPanel.Dock="Left"/>
							<Rectangle Fill="Transparent" x:Name="T1" Height="1" DockPanel.Dock="Top"/>
							<ContentPresenter HorizontalAlignment="Center" Margin="2,2,2,2" x:Name="ContentContainer" VerticalAlignment="Center"/>
						</DockPanel>
						<ControlTemplate.Triggers>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Fill" TargetName="R1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
								<Setter Property="Fill" TargetName="B1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
								<Setter Property="Fill" TargetName="L1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
								<Setter Property="Fill" TargetName="T1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
								<Setter Property="Margin" TargetName="ContentContainer" Value="3,3,1,1"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 Z</Geometry>
		<MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
		<Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
		
		<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
			<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
				<DockPanel>
					<ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
					<Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Collapsed" Data="{StaticResource Checkmark}"/>
					<ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True"/>
					<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" Focusable="false">
						<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">
							<Border x:Name="SubMenuBorder" Background="{DynamicResource {x:Static SystemColors.MenuBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" BorderThickness="1">
								<ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
									<ItemsPresenter Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
								</ScrollViewer>
							</Border>
						</Microsoft_Windows_Themes:SystemDropShadowChrome>
					</Popup>
				</DockPanel>
			</Border>
			<ControlTemplate.Triggers>
				<Trigger Property="IsSuspendingPopupAnimation" Value="true">
					<Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
				</Trigger>
				<Trigger Property="Icon" Value="{x:Null}">
					<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
				</Trigger>
				<Trigger Property="IsChecked" Value="true">
					<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
					<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
				</Trigger>
				<Trigger Property="IsHighlighted" Value="true">
					<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
				<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
					<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
					<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
			<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
				<DockPanel>
					<ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
					<Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Collapsed" Data="{StaticResource Checkmark}"/>
					<ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True"/>
				</DockPanel>
			</Border>
			<ControlTemplate.Triggers>
				<Trigger Property="Icon" Value="{x:Null}">
					<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
				</Trigger>
				<Trigger Property="IsChecked" Value="true">
					<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
					<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
				</Trigger>
				<Trigger Property="IsHighlighted" Value="true">
					<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>
		<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
			<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition MinWidth="17" Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
						<ColumnDefinition Width="14"/>
					</Grid.ColumnDefinitions>
					<ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon"/>
					<Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Hidden" Data="{StaticResource Checkmark}"/>
					<ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True"/>
					<Path Fill="{TemplateBinding Foreground}" Margin="4,0,6,0" VerticalAlignment="Center" Grid.Column="3" Data="{StaticResource RightArrow}" DockPanel.Dock="Right"/>
					<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-3" Focusable="false">
						<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">
							<Border x:Name="SubMenuBorder" Background="{DynamicResource {x:Static SystemColors.MenuBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" BorderThickness="1">
								<ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
									<ItemsPresenter Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle"/>
								</ScrollViewer>
							</Border>
						</Microsoft_Windows_Themes:SystemDropShadowChrome>
					</Popup>
				</Grid>
			</Border>
			<ControlTemplate.Triggers>
				<Trigger Property="IsSuspendingPopupAnimation" Value="true">
					<Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
				</Trigger>
				<Trigger Property="Icon" Value="{x:Null}">
					<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
				</Trigger>
				<Trigger Property="IsChecked" Value="true">
					<Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible"/>
					<Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
				</Trigger>
				<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
					<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
					<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
				</Trigger>
				<Trigger Property="IsHighlighted" Value="true">
					<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<Style x:Key="MenuItemStyle" TargetType="{x:Type MenuItem}">
			<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="Background" Value="#00000000"/>
			<Setter Property="Foreground" Value="{DynamicResource ComicViewerBorderBrush}"/>
			<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
			<Setter Property="BorderBrush" Value="{DynamicResource ComicViewerBorderBrush}"/>
			<Style.Triggers>
				<Trigger Property="Role" Value="TopLevelHeader">
					<Setter Property="Margin" Value="0,1,0,1"/>
					<Setter Property="Padding" Value="6,3,6,3"/>
					<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
				</Trigger>
				<Trigger Property="Role" Value="TopLevelItem">
					<Setter Property="Margin" Value="0,1,0,1"/>
					<Setter Property="Padding" Value="6,3,6,3"/>
					<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
				</Trigger>
				<Trigger Property="Role" Value="SubmenuHeader">
					<Setter Property="DockPanel.Dock" Value="Top"/>
					<Setter Property="Padding" Value="0,2,0,2"/>
					<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}"/>
				</Trigger>
				<Trigger Property="Role" Value="SubmenuItem">
					<Setter Property="DockPanel.Dock" Value="Top"/>
					<Setter Property="Padding" Value="0,2,0,2"/>
				</Trigger>
			</Style.Triggers>
		</Style>
		<SolidColorBrush x:Key="ComicTextColor" Color="#FF9B9B9B"/>
		<LinearGradientBrush x:Key="ExpanderShadowFill" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="Transparent" Offset="0.5"/>
			<GradientStop Color="#30111111" Offset="1"/>
		</LinearGradientBrush>
		<Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Border Padding="{TemplateBinding Padding}">
							<Grid SnapsToDevicePixels="False" Background="Transparent">
								<Grid.RowDefinitions>
									<RowDefinition Height="19"/>
									<RowDefinition Height="*"/>
								</Grid.RowDefinitions>
								<Grid>
									<Grid.LayoutTransform>
										<TransformGroup>
											<TransformGroup.Children>
												<TransformCollection>
													<RotateTransform Angle="-90"/>
												</TransformCollection>
											</TransformGroup.Children>
										</TransformGroup>
									</Grid.LayoutTransform>
									<Ellipse Fill="{DynamicResource ButtonNormalBackgroundFill}" Stroke="DarkGray" HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
									<Ellipse Fill="{DynamicResource ExpanderShadowFill}" HorizontalAlignment="Center" x:Name="shadow" VerticalAlignment="Center" Width="17" Height="17" Visibility="Hidden"/>
									<Path Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5  L 4.5,5  L 8,1.5"/>
								</Grid>
								<ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" SnapsToDevicePixels="True" Grid.Row="1" RecognizesAccessKey="True"/>
							</Grid>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#666"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
								<Setter Property="Visibility" TargetName="shadow" Value="Visible"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Border Padding="{TemplateBinding Padding}">
							<Grid SnapsToDevicePixels="False" Background="Transparent">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="19"/>
									<ColumnDefinition Width="*"/>
								</Grid.ColumnDefinitions>
								<Grid>
									<Grid.LayoutTransform>
										<TransformGroup>
											<TransformGroup.Children>
												<TransformCollection>
													<RotateTransform Angle="180"/>
												</TransformCollection>
											</TransformGroup.Children>
										</TransformGroup>
									</Grid.LayoutTransform>
									<Ellipse Fill="{DynamicResource ButtonNormalBackgroundFill}" Stroke="DarkGray" HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
									<Ellipse Fill="{DynamicResource ExpanderShadowFill}" HorizontalAlignment="Center" x:Name="shadow" VerticalAlignment="Center" Width="17" Height="17" Visibility="Hidden"/>
									<Path Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5  L 4.5,5  L 8,1.5"/>
								</Grid>
								<ContentPresenter HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" SnapsToDevicePixels="True" Grid.Column="1" RecognizesAccessKey="True"/>
							</Grid>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#666"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
								<Setter Property="Visibility" TargetName="shadow" Value="Visible"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Border Padding="{TemplateBinding Padding}">
							<Grid SnapsToDevicePixels="False" Background="Transparent">
								<Grid.RowDefinitions>
									<RowDefinition Height="19"/>
									<RowDefinition Height="*"/>
								</Grid.RowDefinitions>
								<Grid>
									<Grid.LayoutTransform>
										<TransformGroup>
											<TransformGroup.Children>
												<TransformCollection>
													<RotateTransform Angle="90"/>
												</TransformCollection>
											</TransformGroup.Children>
										</TransformGroup>
									</Grid.LayoutTransform>
									<Ellipse Fill="{DynamicResource ButtonNormalBackgroundFill}" Stroke="DarkGray" HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
									<Ellipse Fill="{DynamicResource ExpanderShadowFill}" HorizontalAlignment="Center" x:Name="shadow" VerticalAlignment="Center" Width="17" Height="17" Visibility="Hidden"/>
									<Path Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
								</Grid>
								<ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" SnapsToDevicePixels="True" Grid.Row="1" RecognizesAccessKey="True"/>
							</Grid>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#666"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
								<Setter Property="Visibility" TargetName="shadow" Value="Visible"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ExpanderHeaderFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Border>
							<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="0" SnapsToDevicePixels="true"/>
						</Border>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Border Padding="{TemplateBinding Padding}">
							<Grid SnapsToDevicePixels="False" Background="Transparent">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="19"/>
									<ColumnDefinition Width="*"/>
								</Grid.ColumnDefinitions>
								<Ellipse Fill="{DynamicResource ButtonNormalBackgroundFill}" Stroke="DarkGray" HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
								<Ellipse Fill="{DynamicResource ExpanderShadowFill}" HorizontalAlignment="Center" x:Name="shadow" VerticalAlignment="Center" Width="17" Height="17" Visibility="Hidden"/>
								<Path Stroke="#666" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
								<ContentPresenter HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" SnapsToDevicePixels="True" Grid.Column="1" RecognizesAccessKey="True"/>
							</Grid>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsChecked" Value="true">
								<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
							</Trigger>
							<Trigger Property="IsMouseOver" Value="true">
								<Setter Property="Stroke" TargetName="circle" Value="#666"/>
								<Setter Property="Stroke" TargetName="arrow" Value="#222"/>
								<Setter Property="Visibility" TargetName="shadow" Value="Visible"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ThumNailExpanderStyle" TargetType="{x:Type Expander}">
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
			<Setter Property="VerticalContentAlignment" Value="Stretch"/>
			<Setter Property="BorderBrush" Value="Transparent"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Expander}">
						<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
							<DockPanel>
								<ToggleButton FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" Margin="1" MinHeight="0" MinWidth="0" x:Name="HeaderSite" Style="{StaticResource ExpanderDownHeaderStyle}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" DockPanel.Dock="Top"/>
								<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Focusable="false" Visibility="Collapsed" DockPanel.Dock="Bottom"/>
							</DockPanel>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsExpanded" Value="true">
								<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
							</Trigger>
							<Trigger Property="ExpandDirection" Value="Right">
								<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
								<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
								<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/>
							</Trigger>
							<Trigger Property="ExpandDirection" Value="Up">
								<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/>
								<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
								<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}"/>
							</Trigger>
							<Trigger Property="ExpandDirection" Value="Left">
								<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/>
								<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
								<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="GridSplitterPreviewStyle">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Fill="#80000000"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ComboBoxItemStyle" TargetType="{x:Type ComboBoxItem}">
			<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
			<Setter Property="Padding" Value="3,0,3,0"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ComboBoxItem}">
						<Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsHighlighted" Value="true">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="Foreground" Value="{DynamicResource ComicViewerSelectionBG}"/>
			<Setter Property="Background" Value="#FF000000"/>
		</Style>
		<Style x:Key="ComboBoxFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="4,4,21,4" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ComboBoxTransparentButtonStyle" TargetType="{x:Type ToggleButton}">
			<Setter Property="MinWidth" Value="0"/>
			<Setter Property="MinHeight" Value="0"/>
			<Setter Property="Width" Value="Auto"/>
			<Setter Property="Height" Value="Auto"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="ClickMode" Value="Press"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ToggleButton}">
						<Grid SnapsToDevicePixels="true" Background="#00FFFFFF">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto" SharedSizeGroup="ComboBoxButton" MinWidth="16.979"/>
							</Grid.ColumnDefinitions>
							<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" Height="Auto" SnapsToDevicePixels="true" BorderBrush="{DynamicResource ComicViewerBorderBrush}" Fill="#FF0A0A0A" RenderDefaulted="{TemplateBinding Button.IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" ThemeColor="NormalColor" HorizontalAlignment="Stretch" Margin="0,-0.25,-0.002,0" Grid.Column="1" Width="17">
								<Path Fill="#FF0A0A0A" Stretch="Fill" Stroke="{DynamicResource ComicViewerBorderBrush}" Width="5.314" Height="9.313" RenderTransformOrigin="0.5,0.5" Data="M4.002,8.917 L8.3164999,10.6255 4.0360038,12.605579">
									<Path.RenderTransform>
										<TransformGroup>
											<ScaleTransform ScaleX="1" ScaleY="1"/>
											<SkewTransform AngleX="0" AngleY="0"/>
											<RotateTransform Angle="90"/>
											<TranslateTransform X="0" Y="0"/>
										</TransformGroup>
									</Path.RenderTransform>
								</Path>
							</Microsoft_Windows_Themes:ButtonChrome>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="BorderBrush" Value="{DynamicResource ComicViewerBorderBrush}"/>
		</Style>
		<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="AllowDrop" Value="true"/>
			<Setter Property="MinWidth" Value="0"/>
			<Setter Property="MinHeight" Value="0"/>
			<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TextBox}">
						<ScrollViewer x:Name="PART_ContentHost" Background="Transparent" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
			<Grid SnapsToDevicePixels="true">
				<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
					<Grid Grid.IsSharedSizeScope="true">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="1"/>
							<ColumnDefinition Width="*"/>
							<ColumnDefinition Width="Auto" SharedSizeGroup="ComboBoxButton"/>
						</Grid.ColumnDefinitions>
						<TextBox Margin="{TemplateBinding Padding}" x:Name="PART_EditableTextBox" Style="{StaticResource ComboBoxEditableTextBox}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" IsReadOnly="{Binding Path=IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"/>
						<ToggleButton Style="{StaticResource ComboBoxTransparentButtonStyle}" Background="{x:Null}" Grid.ColumnSpan="3" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
					</Grid>
				</Border>
				<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Focusable="false">
					<Microsoft_Windows_Themes:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="Shdw" Color="Transparent">
						<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
							<ScrollViewer>
								<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
							</ScrollViewer>
						</Border>
					</Microsoft_Windows_Themes:SystemDropShadowChrome>
				</Popup>
			</Grid>
			<ControlTemplate.Triggers>
				<Trigger Property="HasItems" Value="false">
					<Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
					<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
				</Trigger>
				<Trigger Property="IsGrouping" Value="true">
					<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
				</Trigger>
				<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
					<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
					<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<Style x:Key="ComboBoxStyle" TargetType="{x:Type ComboBox}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
			<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ComboBox}">
						<Grid SnapsToDevicePixels="true">
							<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
								<Grid Grid.IsSharedSizeScope="true">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="1"/>
										<ColumnDefinition Width="*"/>
										<ColumnDefinition Width="Auto" SharedSizeGroup="ComboBoxButton"/>
									</Grid.ColumnDefinitions>
									<Border Margin="{TemplateBinding Padding}" x:Name="SelectedItemBorder" Grid.ColumnSpan="2"/>
									<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="1" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
									<ToggleButton Style="{StaticResource ComboBoxTransparentButtonStyle}" Grid.ColumnSpan="3" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" x:Name="toggleButton"/>
								</Grid>
							</Border>
							<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Focusable="false">
								<Microsoft_Windows_Themes:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="Shdw" Color="Transparent">
									<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
										<ScrollViewer>
											<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
										</ScrollViewer>
									</Border>
								</Microsoft_Windows_Themes:SystemDropShadowChrome>
							</Popup>
						</Grid>
						<ControlTemplate.Triggers>
							<MultiTrigger>
								<MultiTrigger.Conditions>
									<Condition Property="IsSelectionBoxHighlighted" Value="true"/>
									<Condition Property="IsDropDownOpen" Value="false"/>
								</MultiTrigger.Conditions>
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
							</MultiTrigger>
							<Trigger Property="IsSelectionBoxHighlighted" Value="true">
								<Setter Property="BorderBrush" TargetName="toggleButton" Value="{DynamicResource ComicViewerBorderBrush}"/>
							</Trigger>
                            <Trigger Property="Validation.HasError" Value="true">
                                <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self},Path=(Validation.Errors)[0].ErrorContent}" />
                            </Trigger>
                            <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
								<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
								<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
							</Trigger>
							<Trigger Property="HasItems" Value="false">
								<Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							</Trigger>
							<Trigger Property="IsGrouping" Value="true">
								<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Style.Triggers>
				<Trigger Property="IsEditable" Value="true">
					<Setter Property="IsTabStop" Value="false"/>
					<Setter Property="Padding" Value="0,1"/>
					<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
				</Trigger>
			</Style.Triggers>
		</Style>
		<Style x:Key="ComicScrollViewerStyle" TargetType="{x:Type ScrollViewer}">
			<Style.Triggers>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</Style.Triggers>
			<Setter Property="Template" Value="{DynamicResource ScrollViewerControlTemplate}"/>
		</Style>
		<ControlTemplate x:Key="ScrollViewerControlTemplate" TargetType="{x:Type ScrollViewer}">
			<Grid x:Name="Grid" Background="{TemplateBinding Background}">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="Auto"/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="*"/>
					<RowDefinition Height="Auto"/>
				</Grid.RowDefinitions>
				<Rectangle Fill="{DynamicResource ComicViewerBorderBrush}" x:Name="Corner" Grid.Column="1" Grid.Row="1"/>
				<ScrollContentPresenter Margin="{TemplateBinding Padding}" x:Name="PART_ScrollContentPresenter" Grid.Column="0" Grid.Row="0" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False"/>
				<ScrollBar Cursor="Arrow" x:Name="PART_VerticalScrollBar" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="1" Grid.Row="0" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="VerticalScrollBar" Background="{DynamicResource ComicViewerBorderBrush}"/>
				<ScrollBar Cursor="Arrow" x:Name="PART_HorizontalScrollBar" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="HorizontalScrollBar" Style="{DynamicResource HoriScrollBarStyle}" Background="{DynamicResource ComicViewerBorderBrush}"/>
			</Grid>
		</ControlTemplate>
		<LinearGradientBrush x:Key="VerticalScrollBarPageButtonNormal" EndPoint="1, 0" StartPoint="0, 0">
			<GradientStop Color="#EEEDE5" Offset="0"/>
			<GradientStop Color="#EEEDE5" Offset="0.05"/>
			<GradientStop Color="#F3F1EC" Offset="0.06"/>
			<GradientStop Color="#FEFEFE" Offset="0.94"/>
			<GradientStop Color="#EEEDE5" Offset="0.95"/>
			<GradientStop Color="#EEEDE5" Offset="1"/>
		</LinearGradientBrush>
		<Style x:Key="ScrollBarButton" TargetType="{x:Type RepeatButton}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RepeatButton}">
						<Microsoft_Windows_Themes:ScrollChrome x:Name="Chrome" SnapsToDevicePixels="true" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="{TemplateBinding Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph}" ThemeColor="NormalColor"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="VerticalScrollBarPageButtonPressed" EndPoint="1, 0" StartPoint="0, 0">
			<GradientStop Color="#D7D5C2" Offset="0"/>
			<GradientStop Color="#D7D5C2" Offset="0.05"/>
			<GradientStop Color="#E3DED3" Offset="0.06"/>
			<GradientStop Color="#FDFDF6" Offset="0.94"/>
			<GradientStop Color="#D7D5C2" Offset="0.95"/>
			<GradientStop Color="#D7D5C2" Offset="1"/>
		</LinearGradientBrush>
		<Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RepeatButton}">
						<Rectangle Fill="{TemplateBinding Background}" x:Name="Bg"/>
						<ControlTemplate.Triggers>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Fill" TargetName="Bg" Value="{StaticResource VerticalScrollBarPageButtonPressed}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Thumb}">
						<Microsoft_Windows_Themes:ScrollChrome x:Name="Chrome" SnapsToDevicePixels="true" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsDragging}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="{TemplateBinding Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph}" ThemeColor="NormalColor"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="HorizontalScrollBarPageButtonNormal" EndPoint="0, 1" StartPoint="0, 0">
			<GradientStop Color="#EEEDE5" Offset="0"/>
			<GradientStop Color="#EEEDE5" Offset="0.05"/>
			<GradientStop Color="#F3F1EC" Offset="0.06"/>
			<GradientStop Color="#FEFEFE" Offset="0.94"/>
			<GradientStop Color="#EEEDE5" Offset="0.95"/>
			<GradientStop Color="#EEEDE5" Offset="1"/>
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="HorizontalScrollBarPageButtonPressed" EndPoint="0, 1" StartPoint="0, 0">
			<GradientStop Color="#D7D5C2" Offset="0"/>
			<GradientStop Color="#D7D5C2" Offset="0.05"/>
			<GradientStop Color="#E3DED3" Offset="0.06"/>
			<GradientStop Color="#FDFDF6" Offset="0.94"/>
			<GradientStop Color="#D7D5C2" Offset="0.95"/>
			<GradientStop Color="#D7D5C2" Offset="1"/>
		</LinearGradientBrush>
		<Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RepeatButton}">
						<Rectangle Fill="{TemplateBinding Background}" x:Name="Bg"/>
						<ControlTemplate.Triggers>
							<Trigger Property="IsPressed" Value="true">
								<Setter Property="Fill" TargetName="Bg" Value="{StaticResource HorizontalScrollBarPageButtonPressed}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="HoriScrollBarStyle" TargetType="{x:Type ScrollBar}">
			<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
			<Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
			<Setter Property="Background" Value="{StaticResource VerticalScrollBarPageButtonNormal}"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="Width" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
			<Setter Property="MinWidth" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ScrollBar}">
						<Grid SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
							<Grid.RowDefinitions>
								<RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/>
								<RowDefinition Height="0.00001*"/>
								<RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}"/>
							</Grid.RowDefinitions>
							<RepeatButton Style="{StaticResource ScrollBarButton}" Command="{x:Static ScrollBar.LineUpCommand}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="UpArrow"/>
							<Track x:Name="PART_Track" Grid.Row="1" IsDirectionReversed="true">
								<Track.DecreaseRepeatButton>
									<RepeatButton Style="{StaticResource VerticalScrollBarPageButton}" Command="{x:Static ScrollBar.PageUpCommand}"/>
								</Track.DecreaseRepeatButton>
								<Track.IncreaseRepeatButton>
									<RepeatButton Style="{StaticResource VerticalScrollBarPageButton}" Command="{x:Static ScrollBar.PageDownCommand}"/>
								</Track.IncreaseRepeatButton>
								<Track.Thumb>
									<Thumb Style="{StaticResource ScrollBarThumb}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="VerticalGripper"/>
								</Track.Thumb>
							</Track>
							<RepeatButton Style="{StaticResource ScrollBarButton}" Grid.Row="2" Command="{x:Static ScrollBar.LineDownCommand}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="DownArrow"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Style.Triggers>
				<Trigger Property="Orientation" Value="Horizontal">
					<Setter Property="Width" Value="Auto"/>
					<Setter Property="MinWidth" Value="0"/>
					<Setter Property="Background" Value="{StaticResource HorizontalScrollBarPageButtonNormal}"/>
					<Setter Property="Height" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
					<Setter Property="MinHeight" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}"/>
					<Setter Property="Template">
						<Setter.Value>
							<ControlTemplate TargetType="{x:Type ScrollBar}">
								<Grid SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
									<Grid.ColumnDefinitions>
										<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
										<ColumnDefinition Width="0.00001*"/>
										<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
									</Grid.ColumnDefinitions>
									<RepeatButton Style="{StaticResource ScrollBarButton}" Command="{x:Static ScrollBar.LineLeftCommand}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="LeftArrow"/>
									<Track x:Name="PART_Track" Grid.Column="1">
										<Track.DecreaseRepeatButton>
											<RepeatButton Style="{StaticResource HorizontalScrollBarPageButton}" Command="{x:Static ScrollBar.PageLeftCommand}" BorderBrush="{DynamicResource ComicViewerBorderBrush}"/>
										</Track.DecreaseRepeatButton>
										<Track.IncreaseRepeatButton>
											<RepeatButton Style="{StaticResource HorizontalScrollBarPageButton}" Command="{x:Static ScrollBar.PageRightCommand}"/>
										</Track.IncreaseRepeatButton>
										<Track.Thumb>
											<Thumb Style="{StaticResource ScrollBarThumb}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="HorizontalGripper"/>
										</Track.Thumb>
									</Track>
									<RepeatButton Style="{StaticResource ScrollBarButton}" Grid.Column="2" Command="{x:Static ScrollBar.LineRightCommand}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="RightArrow"/>
								</Grid>
							</ControlTemplate>
						</Setter.Value>
					</Setter>
				</Trigger>
			</Style.Triggers>
		</Style>
		<Style x:Key="SystemButtonsStyle" TargetType="{x:Type Button}">
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackgroundFill}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonBorder}"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="ForceCursor" Value="True"/>
		</Style>
		<ControlTemplate x:Key="FirstPageButtonTemplate" TargetType="{x:Type Button}">
			<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}" RenderDefaulted="{TemplateBinding IsDefaulted}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" ThemeColor="NormalColor">
				<Grid>
					<Path Stretch="Fill" Stroke="{DynamicResource ComicViewerBorderBrush}" HorizontalAlignment="Left" Margin="4.054,0,0,0" Width="1.002" Data="M3.999,1.8825 L3.999,11.07" Fill="{DynamicResource ComicViewerBorderBrush}"/>
					<Path Stretch="Fill" Stroke="{DynamicResource ComicViewerBorderBrush}" Margin="5.062,0.195,4.253,0.314" Data="M3.999,6.32 L9.6865001,0.19500017 9.6865001,12.6325 z" Fill="{DynamicResource ComicViewerBorderBrush}"/>
				</Grid>
			</Microsoft_Windows_Themes:ButtonChrome>
			<ControlTemplate.Triggers>
				<Trigger Property="IsKeyboardFocused" Value="true">
					<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="ToggleButton.IsChecked" Value="true">
					<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="false">
					<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<Style x:Key="PageButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackgroundFill}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonBorder}"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
		</Style>
		<Style x:Key="CloseButtonStyle1" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackgroundFill}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonBorder}"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true"/>
							<Trigger Property="ToggleButton.IsChecked" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Open" Executed="Open_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.Exit" Executed="Exit_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.Maximise" Executed="Maximise_Executed"/>
        <CommandBinding Command="local:ApplicationCommandsDefinition.Minimise" Executed="Minimise_Executed"/>
        <CommandBinding Command="local:ApplicationCommandsDefinition.PreviousPage" CanExecute="FirstPage_CanExecute" Executed="PreviousPage_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.NextPage" CanExecute="LastPage_CanExecute"  Executed="NextPage_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.FirstPage" CanExecute="FirstPage_CanExecute" Executed="FirstPage_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.LastPage" CanExecute="LastPage_CanExecute" Executed="LastPage_Executed"/>
        <CommandBinding Command="local:ApplicationCommandsDefinition.GotoPage" CanExecute="Is_FileOpen"/>
        <CommandBinding Command="local:ApplicationCommandsDefinition.ZoomFitWidth" Executed="ZoomFitWidth_Executed"/>
        <CommandBinding Command="local:ApplicationCommandsDefinition.ZoomOriginal" Executed="ZoomOriginal_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.ZoomFit" Executed="ZoomFit_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.RotateNormal" Executed="RotateNormal_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.Rotate90" Executed="Rotate90_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.Rotate180" Executed="Rotate180_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.Rotate90CounterClock" Executed="Rotate270_Executed"/>
        <CommandBinding Command="local:ApplicationCommandsDefinition.ModeSinglePage" Executed="ModeSinglePage_Executed"/>
        <CommandBinding Command="local:ApplicationCommandsDefinition.ModeContinuousPage" Executed="ModeContinuousPage_Executed"/>
        <CommandBinding Command="local:ApplicationCommandsDefinition.ModeDoublePage" Executed="ModeDoublePage_Executed"/>
        <CommandBinding Command="local:ApplicationCommandsDefinition.ModeDoubleContinuousPage" Executed="ModeDoubleContinuousPage_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.Fullscreen" CanExecute="Is_FileOpen" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.About" Executed="ShowAbout_Executed" />
        <CommandBinding Command="local:ApplicationCommandsDefinition.OpenFolder" Executed="OpenFolder_Executed" />
    </Window.CommandBindings>
	<Grid Width="Auto" Height="Auto" Background="#FF000000" MouseDown="Grid_MouseDown">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="0.161*"/>
			<ColumnDefinition Width="0.839*"/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="24"/>
			<RowDefinition Height="*"/>
			<RowDefinition Height="24.917"/>
		</Grid.RowDefinitions>
		<Menu x:Name="mainMenu" Margin="0,-1.5,0,0" ItemContainerStyle="{StaticResource MenuItemStyle}" Background="{x:Null}" Foreground="{x:Null}">
			<MenuItem Header="File" Style="{StaticResource MenuItemStyle}" >
				<MenuItem Command="ApplicationCommands.Open"/>
				<MenuItem Command="local:ApplicationCommandsDefinition.OpenFolder" />
				<Separator/>
				<MenuItem Header="Exit" Command="local:ApplicationCommandsDefinition.Exit"/>
			</MenuItem>
			<MenuItem Header="Go">
				<MenuItem Command="local:ApplicationCommandsDefinition.PreviousPage"/>
				<MenuItem Command="local:ApplicationCommandsDefinition.NextPage"/>
				<Separator/>
				<MenuItem Command="local:ApplicationCommandsDefinition.FirstPage"/>
				<MenuItem Command="local:ApplicationCommandsDefinition.LastPage"/>
				<MenuItem Command="local:ApplicationCommandsDefinition.GotoPage"/>
				<Separator/>
				<MenuItem Command="local:ApplicationCommandsDefinition.PageBufferLength"/>
			</MenuItem>
			<MenuItem Header="View">
				<MenuItem Header="Zoom" IsEnabled="{Binding Source={x:Static Application.Current},Path =MainWindow.IsFileOpened,Mode=OneWay}">
					<MenuItem Command="local:ApplicationCommandsDefinition.ZoomFit" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.ZoomText, Mode=OneWay,Converter={StaticResource ZoomTextToBool},ConverterParameter=Fit}" />
					<MenuItem Command="local:ApplicationCommandsDefinition.ZoomOriginal" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.ZoomText, Mode=OneWay,Converter={StaticResource ZoomTextToBool},ConverterParameter=Original}"/>
					<MenuItem Command="local:ApplicationCommandsDefinition.ZoomFitWidth" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.ZoomText, Mode=OneWay,Converter={StaticResource ZoomTextToBool},ConverterParameter=FitWidth}"/>
				</MenuItem>
				<MenuItem Header="Rotate" IsEnabled="{Binding Source={x:Static Application.Current},Path =MainWindow.IsFileOpened,Mode=OneWay}">
					<MenuItem Command="local:ApplicationCommandsDefinition.RotateNormal" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.RotatePage, Mode=OneWay,Converter={StaticResource RotatePageToBool},ConverterParameter=Normal}"/>
					<MenuItem Command="local:ApplicationCommandsDefinition.Rotate90" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.RotatePage, Mode=OneWay,Converter={StaticResource RotatePageToBool},ConverterParameter=90}"/>
					<MenuItem Command="local:ApplicationCommandsDefinition.Rotate180" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.RotatePage, Mode=OneWay,Converter={StaticResource RotatePageToBool},ConverterParameter=180}"/>
					<MenuItem Command="local:ApplicationCommandsDefinition.Rotate90CounterClock" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.RotatePage, Mode=OneWay,Converter={StaticResource RotatePageToBool},ConverterParameter=270}"/>
				</MenuItem>
				<MenuItem Header="Mode" IsEnabled="{Binding Source={x:Static Application.Current},Path =MainWindow.IsFileOpened,Mode=OneWay}">
					<MenuItem Command="local:ApplicationCommandsDefinition.ModeSinglePage" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.PanelMode, Mode=OneWay,Converter={StaticResource PanelModeToBool},ConverterParameter=Single}"/>
					<MenuItem Command="local:ApplicationCommandsDefinition.ModeDoublePage" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.PanelMode, Mode=OneWay,Converter={StaticResource PanelModeToBool},ConverterParameter=Double}"/>
                    <MenuItem Command="local:ApplicationCommandsDefinition.ModeContinuousPage" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.PanelMode, Mode=OneWay,Converter={StaticResource PanelModeToBool},ConverterParameter=Continuous}"/>
                    <MenuItem Command="local:ApplicationCommandsDefinition.ModeDoubleContinuousPage" IsChecked="{Binding Source={x:Static Application.Current}, Path=MainWindow.PanelMode, Mode=OneWay,Converter={StaticResource PanelModeToBool},ConverterParameter=DoubleContinuous}"/>
				</MenuItem>
				<Separator/>
				<MenuItem Command="local:ApplicationCommandsDefinition.Fullscreen"/>
				<Separator/>
				<MenuItem Command="local:ApplicationCommandsDefinition.ThumbnailViewer"/>
				<MenuItem Command="local:ApplicationCommandsDefinition.Toolbar"/>
			</MenuItem>
			<MenuItem Header="Help">
				<MenuItem Command="local:ApplicationCommandsDefinition.About"/>
			</MenuItem>
		</Menu>
		<Grid Grid.ColumnSpan="2" Grid.Row="2">
			<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
				<StackPanel Width="231.999" Orientation="Horizontal" Height="24.917">
					<Button Margin="0,0,3,0" Style="{StaticResource PageButtonStyle}" Width="23.999" Height="21.946" Content="" Background="{x:Null}"
                            BorderBrush="{StaticResource ComicViewerBorderBrush}"
                            Command="local:ApplicationCommandsDefinition.FirstPage" Template="{StaticResource FirstPageButtonTemplate}"/>
					<Button Width="23.999" Height="21.946" Content="" Margin="0,0,3,0" Style="{StaticResource PageButtonStyle}"
                            Background="{x:Null}" BorderBrush="{StaticResource ComicViewerBorderBrush}"
                            Command="local:ApplicationCommandsDefinition.PreviousPage" Template="{StaticResource PreviousPageButtonTemplate}"/>
					<ComboBox Margin="0,0,3,0" Width="120.001" IsSynchronizedWithCurrentItem="True" x:Name="pagesCombo"
                              SelectedIndex="{Binding Path=MainWindow.CurrentPage, Mode=TwoWay, Source={x:Static Application.Current}}"
                              Background="{x:Null}" BorderBrush="{StaticResource ComicViewerBorderBrush}"
                              Foreground="{StaticResource ComicTextColor}" Style="{StaticResource ComboBoxStyle}"
                              ItemContainerStyle="{StaticResource ComboBoxItemStyle}" PreviewKeyDown="ListBox_PreviewKeyDown" />
					<Button Width="23.999" Height="21.946" Content="" Margin="0,0,3,0" Style="{StaticResource PageButtonStyle}"
                            Background="{x:Null}" BorderBrush="{StaticResource ComicViewerBorderBrush}"
                            Command="local:ApplicationCommandsDefinition.NextPage" Template="{StaticResource NextPageButtonTemplate}"/>
					<Button Width="23.999" Height="21.946" Content="" Margin="0,0,0,0" Style="{StaticResource PageButtonStyle}"
                            Background="{x:Null}" BorderBrush="{StaticResource ComicViewerBorderBrush}"
                            Command="local:ApplicationCommandsDefinition.LastPage" Template="{StaticResource LastPageButtonTemplate}"/>
				</StackPanel>
				<ListBox IsSynchronizedWithCurrentItem="True" ItemsPanel="{StaticResource TopButtonsItemsPanelTemplate}" 
                         Width="102.917" Height="24" 
                         SelectedIndex="{Binding Path=MainWindow.PanelMode, Converter={StaticResource PanelModeToInt}, Mode=TwoWay, Source={x:Static Application.Current}}"
                         ItemContainerStyle="{StaticResource ThumNailListBoxItemStyle}" Background="#FF000000" 
                         BorderBrush="{StaticResource ComicViewerBorderBrush}" PreviewKeyDown="ListBox_PreviewKeyDown">
					<Border Margin="0,0,3,0" Width="20" Height="20" BorderBrush="{StaticResource ComicViewerBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3">
						<Rectangle Fill="{StaticResource ComicViewerBorderBrush}" Stroke="{StaticResource ComicViewerBorderBrush}" Width="10.5" Height="13.333"/>
					</Border>
					<Border Width="20" Height="20" Margin="0,0,3,0" BorderBrush="{StaticResource ComicViewerBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3">
						<Grid Width="15.583" Height="16.667">
							<Rectangle Fill="{StaticResource ComicViewerBorderBrush}" Stroke="{StaticResource ComicViewerBorderBrush}" Margin="1.296,1.835,1.04,0" VerticalAlignment="Top" Height="5.584"/>
							<Rectangle Fill="{StaticResource ComicViewerBorderBrush}" Stroke="{StaticResource ComicViewerBorderBrush}" Margin="1.296,0,1.04,2.456" VerticalAlignment="Bottom" Height="5.584"/>
						</Grid>
					</Border>
					<Border Width="20" Height="20" Margin="0,0,3,0" BorderBrush="{StaticResource ComicViewerBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3">
						<Grid Width="15.583" Height="16.667" RenderTransformOrigin="0.5,0.5">
							<Grid.RenderTransform>
								<TransformGroup>
									<ScaleTransform ScaleX="1" ScaleY="1"/>
									<SkewTransform AngleX="0" AngleY="0"/>
									<RotateTransform Angle="90"/>
									<TranslateTransform X="0" Y="0"/>
								</TransformGroup>
							</Grid.RenderTransform>
							<Rectangle Fill="{StaticResource ComicViewerBorderBrush}" Stroke="{StaticResource ComicViewerBorderBrush}" Margin="1.296,1.835,1.04,0" VerticalAlignment="Top" Height="5.584"/>
							<Rectangle Fill="{StaticResource ComicViewerBorderBrush}" Stroke="{StaticResource ComicViewerBorderBrush}" Margin="1.296,0,1.04,2.456" VerticalAlignment="Bottom" Height="5.584"/>
						</Grid>
					</Border>
					<Border Width="20" Height="20" BorderBrush="{StaticResource ComicViewerBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3">
						<Grid Width="15.583" Height="16.667" RenderTransformOrigin="0.5,0.5">
							<Grid.RenderTransform>
								<TransformGroup>
									<ScaleTransform ScaleX="1" ScaleY="1"/>
									<SkewTransform AngleX="0" AngleY="0"/>
									<RotateTransform Angle="90"/>
									<TranslateTransform X="0" Y="0"/>
								</TransformGroup>
							</Grid.RenderTransform>
							<Rectangle Fill="{StaticResource ComicViewerBorderBrush}" Stroke="{StaticResource ComicViewerBorderBrush}" Margin="1.296,1.835,0,0" VerticalAlignment="Top" Height="5.584" HorizontalAlignment="Left" Width="6.287"/>
							<Rectangle Fill="{StaticResource ComicViewerBorderBrush}" Stroke="{StaticResource ComicViewerBorderBrush}" Margin="1.296,0,0,2.456" VerticalAlignment="Bottom" Height="5.584" HorizontalAlignment="Left" Width="6.287"/>
							<Rectangle Fill="{StaticResource ComicViewerBorderBrush}" Stroke="{StaticResource ComicViewerBorderBrush}" Margin="0,1.835,0.875,0" VerticalAlignment="Top" Height="5.584" HorizontalAlignment="Right" Width="6.287"/>
							<Rectangle Fill="{StaticResource ComicViewerBorderBrush}" Stroke="{StaticResource ComicViewerBorderBrush}" Margin="0,0,0.875,2.456" VerticalAlignment="Bottom" Height="5.584" HorizontalAlignment="Right" Width="6.287"/>
						</Grid>
					</Border>
				</ListBox>
			</StackPanel>
		</Grid>
		<Grid Grid.Column="1">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" MinWidth="279.844"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<Button HorizontalAlignment="Right" Style="{StaticResource SystemButtonsStyle}" Width="20" Content="" Command="local:ApplicationCommandsDefinition.Minimise" Margin="0,1.833,40.106,2.167" Height="20" Background="#FF000000" Foreground="#FFFFFFFF" BorderBrush="{StaticResource ComicViewerBorderBrush}" Grid.Column="1" d:LayoutOverrides="HorizontalAlignment" Template="{StaticResource MinimiseButtonTemplate}"/>
			<Button Content="" Style="{StaticResource SystemButtonsStyle}" Command="local:ApplicationCommandsDefinition.Maximise" Visibility="Visible" x:Name="button" Margin="0,1.833,20.053,2.167" Height="20" BorderBrush="{StaticResource ComicViewerBorderBrush}" Foreground="#FFFFFFFF" Background="#FF000000" Grid.Column="1" Width="20" d:LayoutOverrides="HorizontalAlignment, Width" HorizontalAlignment="Right" Template="{StaticResource MaximiseButtonTemplate}"/>
			<StackPanel Orientation="Horizontal" d:LayoutOverrides="Width, Height" Margin="0,-0.167,0,0.167" HorizontalAlignment="Center" VerticalAlignment="Center">
				<ListBox Width="51.094" IsSynchronizedWithCurrentItem="True" ItemsPanel="{DynamicResource TopButtonsItemsPanelTemplate}"
                         SelectedIndex="{Binding Path=MainWindow.ImageEffect, Converter={StaticResource ImageEffectTypeToInt}, Mode=TwoWay, Source={x:Static Application.Current}}" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center" Background="#FF000000" BorderBrush="{StaticResource ComicViewerBorderBrush}" Foreground="#FFFFFFFF" ItemContainerStyle="{StaticResource ThumNailListBoxItemStyle}" PreviewKeyDown="ListBox_PreviewKeyDown">
					<Border BorderBrush="{StaticResource ComicViewerBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3" Width="20" Height="20">
						<TextBlock Width="16.375" Height="14.875" FontFamily="Tahoma" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource ComicTextColor}"><Run Text=" "/><Run FontSize="8" Text="No"/></TextBlock>
					</Border>
					<Border Width="20" Height="20" BorderBrush="{StaticResource ComicViewerBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3" Margin="0,0,3,0" Background="{x:Null}">
						<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="14.875" FontFamily="Tahoma" Text=" G" TextWrapping="Wrap" Foreground="{StaticResource ComicTextColor}"/>
					</Border>
				</ListBox>
			</StackPanel>
			<StackPanel Orientation="Horizontal" Grid.Column="1" Margin="8,-0.167,188,0.167">
				<ListBox x:Name="listBox" Width="79.844" IsSynchronizedWithCurrentItem="True"
                         SelectedIndex="{Binding Path=MainWindow.ZoomText, Converter={StaticResource ZoomToSizingType}, Mode=TwoWay, Source={x:Static Application.Current}}" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center" Background="#FF000000" BorderBrush="{DynamicResource ComicViewerBorderBrush}" Foreground="#FFFFFFFF" ItemContainerStyle="{DynamicResource ThumNailListBoxItemStyle}" PreviewKeyDown="ListBox_PreviewKeyDown" Margin="0,0,5,0" ItemsPanel="{DynamicResource TopButtonsItemsPanelTemplate}">
					<Border Width="20" Height="20" BorderBrush="{StaticResource ComicViewerBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3" Margin="0,0,3,0" Background="{x:Null}">
						<Path Stretch="Fill" Width="15.038" Height="13.549" RenderTransformOrigin="0.5,0.5" Data="M7.5439453,6.4812765 C7.3763018,6.4812765 7.2359209,6.513422 7.1228027,6.5777121 C7.0096841,6.6420026 6.9238281,6.7384381 6.8652344,6.8670187 C6.8066406,6.9955993 6.7626953,7.1534767 6.7333984,7.3406515 C6.7041016,7.5278263 6.6894531,7.7442975 6.6894531,7.9900656 C6.6894531,8.2342062 6.7032876,8.4494572 6.730957,8.6358175 C6.758626,8.8221779 6.8001299,8.9796486 6.8554688,9.1082296 C6.9108076,9.2368107 6.9958496,9.3332462 7.1105957,9.3975363 C7.2253418,9.4618263 7.369792,9.4939718 7.5439453,9.4939718 C7.7115889,9.4939718 7.8517661,9.4618263 7.9644775,9.3975363 C8.0771894,9.3332462 8.1624355,9.2368107 8.2202148,9.1082296 C8.2779942,8.9796486 8.3213291,8.8217716 8.3502197,8.6345968 C8.3791094,8.447422 8.3935547,8.2309513 8.3935547,7.9851828 C8.3935547,7.7377868 8.3791094,7.5205016 8.3502197,7.3333273 C8.3213291,7.1461525 8.2779942,6.989089 8.2202148,6.8621359 C8.1624355,6.7351828 8.0771894,6.6399679 7.9644775,6.5764914 C7.8517661,6.5130148 7.7115889,6.4812765 7.5439453,6.4812765 z M7.5439453,5.8318624 C7.8271484,5.8318624 8.0757647,5.8766212 8.2897949,5.9661398 C8.5038242,6.0556579 8.6832676,6.1899352 8.828125,6.3689718 C8.9729824,6.5480084 9.081625,6.7722111 9.1540527,7.0415792 C9.2264814,7.3109474 9.2626953,7.6254821 9.2626953,7.9851828 C9.2626953,8.3513937 9.2258711,8.6702003 9.1522217,8.9416037 C9.0785732,9.213007 8.9680996,9.437006 8.8208008,9.6136007 C8.673502,9.7901955 8.4934483,9.9226418 8.2806396,10.01094 C8.0678301,10.099237 7.8222656,10.143386 7.5439453,10.143386 C7.2607422,10.143386 7.0119224,10.098627 6.7974854,10.009109 C6.5830488,9.91959 6.4029951,9.7853127 6.2573242,9.6062765 C6.1116533,9.4272404 6.0024004,9.2030373 5.9295654,8.9336691 C5.85673,8.6643009 5.8203125,8.3497658 5.8203125,7.9900656 C5.8203125,7.6254821 5.8573403,7.3076925 5.9313965,7.036696 C6.0054522,6.7657003 6.1165361,6.5414977 6.2646484,6.364089 C6.4127607,6.1866803 6.5934248,6.0536237 6.8066406,5.9649191 C7.0198569,5.876215 7.265625,5.8318624 7.5439453,5.8318624 z M2.2216797,3.2439718 C2.0540364,3.2439718 1.9136555,3.2761168 1.8005371,3.3404074 C1.6874186,3.4046977 1.6015625,3.5011332 1.5429689,3.629714 C1.484375,3.7582948 1.4404297,3.9161725 1.4111328,4.1033468 C1.3818359,4.2905211 1.3671875,4.5069923 1.3671875,4.7527609 C1.3671875,4.9969015 1.3810221,5.212152 1.4086914,5.3985128 C1.4363606,5.5848732 1.4778645,5.7423439 1.5332031,5.8709249 C1.5885417,5.9995055 1.673584,6.0959411 1.7883301,6.1602316 C1.9030762,6.2245216 2.0475261,6.2566671 2.2216797,6.2566671 C2.3893228,6.2566671 2.5295002,6.2245216 2.6422119,6.1602316 C2.7549236,6.0959411 2.8401694,5.9995055 2.8979492,5.8709249 C2.955729,5.7423439 2.999064,5.5844665 3.0279541,5.3972921 C3.056844,5.2101178 3.0712891,4.9936466 3.0712891,4.7478781 C3.0712891,4.5004826 3.056844,4.2831974 3.0279541,4.0960226 C2.999064,3.9088483 2.955729,3.7517843 2.8979492,3.6248312 C2.8401694,3.4978781 2.7549236,3.4026632 2.6422119,3.3391867 C2.5295002,3.2757101 2.3893228,3.2439718 2.2216797,3.2439718 z M6.3867188,2.7312765 L7.1923828,2.7312765 L3.3837891,10.001784 L2.578125,10.001784 z M2.2216797,2.5945578 C2.5048828,2.5945578 2.7534993,2.639317 2.9675293,2.7288351 C3.1815591,2.8183534 3.3610024,2.9526308 3.5058594,3.1316671 C3.6507163,3.3107035 3.7593589,3.5349059 3.8317871,3.8042746 C3.9042156,4.0736432 3.9404297,4.3881779 3.9404297,4.7478781 C3.9404297,5.114089 3.9036052,5.4328957 3.8299561,5.704299 C3.7563071,5.9757018 3.6458335,6.1997008 3.4985352,6.376296 C3.3512368,6.5528913 3.1711831,6.6853375 2.958374,6.7736349 C2.7455647,6.8619328 2.5,6.9060812 2.2216797,6.9060812 C1.9384766,6.9060812 1.6896566,6.8613224 1.4752197,6.7718039 C1.260783,6.6822858 1.0807292,6.5480084 0.93505865,6.3689718 C0.78938806,6.1899352 0.68013513,5.9657326 0.6072998,5.6963644 C0.53446454,5.4269958 0.49804688,5.1124611 0.49804688,4.7527609 C0.49804688,4.3881779 0.53507489,4.0703878 0.60913086,3.799392 C0.68318689,3.5283957 0.79427087,3.3041933 0.94238275,3.1267843 C1.0904949,2.9493754 1.2711589,2.8163188 1.484375,2.7276144 C1.6975912,2.6389098 1.9433594,2.5945578 2.2216797,2.5945578 z" Stroke="{StaticResource ComicViewerBorderBrush}" Fill="{StaticResource ComicViewerBorderBrush}">
							<Path.RenderTransform>
								<TransformGroup>
									<ScaleTransform ScaleX="1" ScaleY="1"/>
									<SkewTransform AngleX="0" AngleY="0"/>
									<RotateTransform Angle="0"/>
									<TranslateTransform X="0" Y="0"/>
								</TransformGroup>
							</Path.RenderTransform>
						</Path>
					</Border>
					<Border BorderBrush="{StaticResource ComicViewerBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3" Width="20" Height="20" Margin="0,0,3,0">
						<Grid Width="16" Height="14.833">
							<Path Fill="{StaticResource ComicViewerBorderBrush}" Stretch="Fill" Stroke="{StaticResource ComicViewerBorderBrush}" HorizontalAlignment="Left" Margin="0.062,1.148,0,1.144" Width="4.75" Data="M4,3.124 L4.0625,7.5615001 1.2908266,5.3737466 z"/>
							<Path Fill="{StaticResource ComicViewerBorderBrush}" Stretch="Fill" Stroke="{StaticResource ComicViewerBorderBrush}" HorizontalAlignment="Right" Margin="0,0.964,0.069,1.544" Data="M4,3.124 L4.0625,7.5615001 1.2908266,5.3737466 z" Width="4.75" RenderTransformOrigin="0.5,0.5">
								<Path.RenderTransform>
									<TransformGroup>
										<ScaleTransform ScaleX="1" ScaleY="1"/>
										<SkewTransform AngleX="0" AngleY="0"/>
										<RotateTransform Angle="180"/>
										<TranslateTransform X="0" Y="0"/>
									</TransformGroup>
								</Path.RenderTransform>
							</Path>
						</Grid>
					</Border>
					<Border BorderBrush="{StaticResource ComicViewerBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3" Width="20" Height="20" Margin="0,0,3,0">
						<Grid Width="15.609" Height="15.917">
							<Path Fill="{StaticResource ComicViewerBorderBrush}" Stretch="Fill" Stroke="{StaticResource ComicViewerBorderBrush}" HorizontalAlignment="Left" Margin="0.062,3.958,0,3.959" Width="3.25" Data="M4,3.124 L4.0625,7.5615001 1.2908266,5.3737466 z"/>
							<Path Fill="{StaticResource ComicViewerBorderBrush}" Stretch="Fill" Stroke="{StaticResource ComicViewerBorderBrush}" Margin="6.089,-1.795,6.411,0" Data="M4,3.124 L4.0625,7.5615001 1.2908266,5.3737466 z" RenderTransformOrigin="0.5,0.5" Height="6.5" VerticalAlignment="Top">
								<Path.RenderTransform>
									<TransformGroup>
										<ScaleTransform ScaleX="1" ScaleY="1"/>
										<SkewTransform AngleX="0" AngleY="0"/>
										<RotateTransform Angle="90"/>
										<TranslateTransform X="0" Y="0"/>
									</TransformGroup>
								</Path.RenderTransform>
							</Path>
							<Path Fill="{StaticResource ComicViewerBorderBrush}" Stretch="Fill" Stroke="{StaticResource ComicViewerBorderBrush}" Margin="5.93,0,6.082,-1.432" Data="M4,3.124 L4.0625,7.5615001 1.2908266,5.3737466 z" VerticalAlignment="Bottom" Height="6.5" RenderTransformOrigin="0.5,0.5">
								<Path.RenderTransform>
									<TransformGroup>
										<ScaleTransform ScaleX="1" ScaleY="1"/>
										<SkewTransform AngleX="0" AngleY="0"/>
										<RotateTransform Angle="270"/>
										<TranslateTransform X="0" Y="0"/>
									</TransformGroup>
								</Path.RenderTransform>
							</Path>
							<Path Fill="{StaticResource ComicViewerBorderBrush}" Stretch="Fill" Stroke="{StaticResource ComicViewerBorderBrush}" HorizontalAlignment="Right" Margin="0,4.293,0.07,4.336" Width="3.25" Data="M4,3.124 L4.0625,7.5615001 1.2908266,5.3737466 z" RenderTransformOrigin="0.5,0.5">
								<Path.RenderTransform>
									<TransformGroup>
										<ScaleTransform ScaleX="1" ScaleY="1"/>
										<SkewTransform AngleX="0" AngleY="0"/>
										<RotateTransform Angle="180"/>
										<TranslateTransform X="0" Y="0"/>
									</TransformGroup>
								</Path.RenderTransform>
							</Path>
						</Grid>
					</Border>
				</ListBox>
				<ComboBox HorizontalAlignment="Center" VerticalAlignment="Center" Width="107.156" Height="23.516"
                          IsSynchronizedWithCurrentItem="True"
                          Background="{x:Null}" BorderBrush="{StaticResource ComicViewerBorderBrush}"
                          Foreground="{StaticResource ComicTextColor}" Style="{StaticResource ComboBoxStyle}"
                          ItemContainerStyle="{StaticResource ComboBoxItemStyle}" IsEditable="True"
                          Validation.ErrorTemplate="{StaticResource ValidationTemplate}"
                          >
                    <ComboBox.Text>
                        <Binding Path="MainWindow.ZoomText" Mode="TwoWay" Source="{x:Static Application.Current}">
                            <Binding.ValidationRules>
                                <local:ZoomTextRule/>
                            </Binding.ValidationRules>
                        </Binding>
                    </ComboBox.Text>
                    <ComboBoxItem Content="Actul Size"/>
                    <ComboBoxItem Content="Fit Page"/>
                    <ComboBoxItem Content="Fit Width"/>
                    <ComboBoxItem Content="8.33%"/>
                    <ComboBoxItem Content="12.5%"/>
                    <ComboBoxItem Content="25%"/>
                    <ComboBoxItem Content="33.33%"/>
                    <ComboBoxItem Content="50%"/>
                    <ComboBoxItem Content="66.67%"/>
                    <ComboBoxItem Content="75%"/>
                    <ComboBoxItem Content="100%"/>
                    <ComboBoxItem Content="125%"/>
                    <ComboBoxItem Content="150%"/>
                    <ComboBoxItem Content="200%"/>
                    <ComboBoxItem Content="300%"/>
                    <ComboBoxItem Content="400%"/>
                    <ComboBoxItem Content="600%"/>
                    <ComboBoxItem Content="800%"/>
                    <ComboBoxItem Content="1200%"/>
                    <ComboBoxItem Content="1600%"/>
                    <ComboBoxItem Content="3200%"/>
                    <ComboBoxItem Content="6400%"/>
                </ComboBox>
			</StackPanel>
			<local:CloseButtonControl HorizontalAlignment="Right" Margin="0,1.833,0,2.167" Width="20" Grid.Column="1" Height="20" Command="local:ApplicationCommandsDefinition.Exit"/>
		</Grid>
		<Grid Grid.ColumnSpan="2" Grid.Row="1">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto" MinWidth="23"/>
				<ColumnDefinition Width="*"/>
			</Grid.ColumnDefinitions>
			<Expander Style="{StaticResource ThumNailExpanderStyle}" ExpandDirection="Right" IsExpanded="True" Header="" Expanded="Expander_Expanded" Collapsed="Expander_Collapsed" Width="150">
				<Grid>
					<ListBox IsSynchronizedWithCurrentItem="False" ItemTemplate="{StaticResource ThumbNailItemTemplate}" Background="#FF000000" Foreground="#FFFFFFFF"
						ItemsSource ="{Binding Path=MainWindow.Pages, Mode=OneWay, Source={x:Static Application.Current}}" BorderBrush="{StaticResource ComicViewerBorderBrush}" RenderTransformOrigin="0.5,0.5" 
						SelectedIndex="{Binding Path=MainWindow.CurrentPage, Mode=TwoWay, Source={x:Static Application.Current}}" x:Name="thumNailViewer" Style="{StaticResource ThumNailListBoxStyle}" ItemContainerStyle="{StaticResource ThumNailListBoxItemStyle}"/>
				</Grid>
			</Expander>
			<Border BorderBrush="{StaticResource ComicViewerBorderBrush}" BorderThickness="2,2,2,2" Grid.Column="1">
				<ItemsControl ItemTemplate="{StaticResource MainImageItemTemplate}" ItemsPanel="{StaticResource ItemsPanelTemplate}"
					Style="{DynamicResource ItemsControlStyle}" Width="Auto" Height="Auto" Background="{x:Null}" BorderBrush="#FFED1313" BorderThickness="1,1,1,1"
					ItemsSource="{Binding Path=MainWindow.Pages, Mode=OneWay, Source={x:Static Application.Current}}" x:Name="imageItems" Margin="2,-2,-2,2">
					<!--<Button Content="Button"/>
				<Button Content="Button"/>
				<Button Content="Button"/>
				<Button Content="Button"/>
				<Button Content="Button"/>
				<Button Content="Button"/>
				<Button Content="Button" />
				<Button Content="Button" />-->
				</ItemsControl>
			</Border>
		</Grid>
	</Grid>
</Window>
